﻿using UnityEngine;

public class CollisionManager : MonoBehaviour 
{	
	private BallList ballList;
	private SliceManager sliceManager;	
		
	void Start() 
	{
		ballList = (BallList) GetComponent("BallList");
		sliceManager = (SliceManager) GetComponent("SliceManager");
	}
	
	public void HandleCollision(GameObject slice, Collision col) 
	{	
		sliceManager.AddColorToSlice(slice, col.gameObject.GetComponent<MeshRenderer>().material.color);
		ballList.DestroyBall(col.gameObject);
	}
}